package org.example.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import org.example.domain.entity.ShoppingCart;
import org.example.domain.entity.ShoppingCat;
import org.example.mapper.ShoppingCartMapper;
import org.example.service.IShoppingService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ShoppingServiceImpl implements IShoppingService {

    private ShoppingCartMapper shop;

    public ShoppingServiceImpl(ShoppingCartMapper shop) {
        this.shop = shop;
    }

    @Override
    public List<ShoppingCart> queryAllCat(Integer userId) {
        QueryWrapper<ShoppingCart> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id",userId);

        return shop.selectList(queryWrapper);
    }
}
